#pragma once
#include <websocketpp/config/asio_no_tls_client.hpp>
#include <websocketpp/client.hpp>
#include "action.hpp"
#include "data.hpp"
typedef websocketpp::client<websocketpp::config::asio_client> client;
typedef websocketpp::config::asio_client::message_type::ptr message_ptr;

using websocketpp::lib::placeholders::_1;
using websocketpp::lib::placeholders::_2;
using websocketpp::lib::bind;

class my_connection
{
public:
	void on_message(websocketpp::connection_hdl hdl, client::message_ptr msg);
	void on_fail(websocketpp::connection_hdl hdl);
	void on_open(websocketpp::connection_hdl hdl);
	void on_close(websocketpp::connection_hdl hdl);
};
class my_endpoint
{
public:
	my_endpoint();
	~my_endpoint();
	int socket_connect(std::string uri);
	int socket_send(websocketpp::connection_hdl hdl,const text_t& text);
	
	//	int socket_recv();
private:
	client c;
	my_connection connection;
};


//void on_message(websocketpp::connection_hdl hdl, client::message_ptr msg);
//void on_close(websocketpp::connection_hdl hdl);
//void on_open(websocketpp::connection_hdl hdl);
